<nav:Page xmlns:xom="clr-namespace:Xomega.Framework;assembly=Xomega.Framework.Silverlight"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:nav="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
          Title="Employee Search"
          x:Class="AdventureWorks.Client.Silverlight.EmployeeSearch">
   <Grid Margin="10">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="*"/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid Name="pnlCriteria">
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
         </Grid.ColumnDefinitions>
         <TextBlock Grid.Row="0" Grid.Column="0" Name="lblFirstName" Text="First Name:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="0" Grid.Column="1"
                   xom:Property.Label="{Binding ElementName=lblFirstName}"
                   Name="ctlFirstNameOperator"
                   xom:Property.Name="FirstNameOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Name="ctlFirstName"
                  xom:Property.Name="FirstName"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="1" Grid.Column="0" Name="lblLastName" Text="Last Name:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"
                  xom:Property.Label="{Binding ElementName=lblLastName}"
                  Name="ctlLastName"
                  xom:Property.Name="LastName"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="2" Grid.Column="0" Name="lblManagerLastName"
                    Text="Manager Last Name:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
                  xom:Property.Label="{Binding ElementName=lblManagerLastName}"
                  Name="ctlManagerLastName"
                  xom:Property.Name="ManagerLastName"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="0" Grid.Column="4" Name="lblHireDate" Text="Hire Date:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="0" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblHireDate}"
                   Name="ctlHireDateOperator"
                   xom:Property.Name="HireDateOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="6" Name="ctlHireDate" xom:Property.Name="HireDate"
                  Style="{StaticResource ControlStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="7" Name="ctlHireDate2" xom:Property.Name="HireDate2"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="1" Grid.Column="4" Name="lblState" Text="State:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="1" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblState}"
                   Name="ctlStateOperator"
                   xom:Property.Name="StateOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <ListBox Grid.Row="1" Grid.Column="6" Grid.ColumnSpan="2" Name="ctlState"
                  xom:Property.Name="State"
                  Style="{StaticResource ControlStyle}"
                  MaxHeight="58"/>
         <TextBlock Grid.Row="2" Grid.Column="4" Name="lblZipcode" Text="Zipcode:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="2" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblZipcode}"
                   Name="ctlZipcodeOperator"
                   xom:Property.Name="ZipcodeOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" Name="ctlZipcode"
                  xom:Property.Name="Zipcode"
                  Style="{StaticResource ControlStyle}"/>
      </Grid>
      <Button Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,100,10"
              Width="75"
              Name="btnSearch"
              Click="btnSearch_Click"
              Content="Search"/>
      <Button Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,0,10"
              Width="75"
              Name="btnReset"
              Click="btnReset_Click"
              Content="Reset"/>
      <data:DataGrid Grid.Row="2" Name="gridResults" AutoGenerateColumns="False">
         <data:DataGrid.Columns>
            <data:DataGridTextColumn Header="Id" Binding="{Binding Path=IdProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="First Name"
                                     Binding="{Binding Path=FirstNameProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Last Name" Binding="{Binding Path=LastNameProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Title" Binding="{Binding Path=TitleProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Hire Date" Binding="{Binding Path=HireDateProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Manager" Binding="{Binding Path=ManagerProperty.DisplayStringValue}"/>
            <data:DataGridCheckBoxColumn Header="Salaried" Binding="{Binding Path=SalariedProperty.InternalValue}"/>
            <data:DataGridCheckBoxColumn Header="Current" Binding="{Binding Path=CurrentProperty.InternalValue}"/>
            <data:DataGridTextColumn Header="Gender" Binding="{Binding Path=GenderProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="State Id" Binding="{Binding Path=StateIdProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Street Address"
                                     Binding="{Binding Path=AddressObject.StreetAddressProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="City"
                                     Binding="{Binding Path=AddressObject.CityProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="State"
                                     Binding="{Binding Path=AddressObject.StateProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Zipcode"
                                     Binding="{Binding Path=AddressObject.ZipcodeProperty.DisplayStringValue}"/>
            <data:DataGridTextColumn Header="Country"
                                     Binding="{Binding Path=AddressObject.CountryProperty.DisplayStringValue}"/>
         </data:DataGrid.Columns>
      </data:DataGrid>
      <Button Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,0,0"
              Width="75"
              Name="btnDetails"
              Content="Details"/>
   </Grid>
</nav:Page>